﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using DTO;
using DAO;

namespace BUS
{
    public class KyXBBUS
    {
        #region 1. Them
        public static bool ThemKyXB(KyXBDTO kyxb){
            if (!BaoTapChiDAO.CheckBaoTapChiBangID(kyxb.MaBaoTC))
            {
                return false;
            }
            return KyXBDAO.ThemKyXB(kyxb);
        }
        #endregion
        #region 2. Sua
        public static bool SuaKyXB(KyXBDTO kyxb)
        {
            if (!BaoTapChiDAO.CheckBaoTapChiBangID(kyxb.MaBaoTC))
            {
                return false;
            }
            return KyXBDAO.SuaKyXB(kyxb);
        }
        #endregion
        #region 3. Xoa
        public static bool XoaKyXB(string kyxb)
        {
            return KyXBDAO.XoaKyXB(kyxb);
        }
        #endregion
        #region 4. Tim kiem
        public static KyXBDTO TimKyXB(String makyxb){
            return KyXBDAO.TimKyXB(makyxb);
        }
        public static List<KyXBDTO> TimKyXBCuaBaoTC(String mabtc){
            return KyXBDAO.TimKyXBCuaBaoTC(mabtc);
        }
        public static DataTable TimTatCaKyXB(){
            return KyXBDAO.TimTatCaKyXB();
        }
        #endregion
    }
}
